import java.io.FileWriter;
import java.io.IOException;

/**
 * @author zyj
 * @date 2022年05月30日 14:29
 */
public class FileWriterDemo {
    public static void main(String[] args) {
        FileWriter writer = null;
        try {
            writer = new FileWriter("a.txt",true);
            writer.write("这个是字符流");
            writer.write("\n");
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
